/* 全局变量和通用样式 */
:root {
  /* 颜色变量 */
  --primary-color: #3a7bd5;
  --primary-gradient: linear-gradient(to right, #3a7bd5, #00d2ff);
  --dark-color: #242736;
  --light-color: #f5f6fa;
  --accent-color: #00d2ff;
  --danger-color: #ff416c;
  --success-color: #2ed573;
  --warning-color: #ffa502;
  --gray-color: #8395a7;
  
  /* 布局变量 */
  --sidebar-width: 220px;
  --titlebar-height: 38px;
  --statusbar-height: 24px;
  
  /* 字体和字重 */
  --font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  
  /* 动画时间 */
  --transition-speed: 0.3s;
}

/* 深色主题 */
[data-theme="dark"] {
  --primary-color: #3a7bd5;
  --primary-gradient: linear-gradient(to right, #3a7bd5, #00d2ff);
  --dark-color: #f5f6fa;
  --light-color: #242736;
  --gray-color: #a0aec0;
  
  background-color: #1a1c26;
  color: var(--dark-color);
}

/* 全局重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--dark-color);
  background-color: #f1f2f6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* 链接样式 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
  
  &:hover {
    color: var(--accent-color);
  }
}

/* 按钮基础样式 */
button {
  font-family: var(--font-family);
  cursor: pointer;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  
  &:hover {
    background: rgba(0, 0, 0, 0.25);
  }
}

/* 暗色主题下的滚动条 */
[data-theme="dark"] {
  ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
  }
  
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    
    &:hover {
      background: rgba(255, 255, 255, 0.25);
    }
  }
}

/* 工具类 */
.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.space-between {
  justify-content: space-between;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

/* 过渡动画 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity var(--transition-speed) ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-up-enter-active,
.slide-up-leave-active {
  transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

.slide-up-enter-from,
.slide-up-leave-to {
  transform: translateY(20px);
  opacity: 0;
}

/* 响应式断点 */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 180px;
  }
}

@media (max-width: 480px) {
  :root {
    --sidebar-width: 60px;
  }
}
